package com.company.huisuo.biz.dialog

import android.app.Activity
import androidx.recyclerview.widget.GridLayoutManager
import com.company.huisuo.R
import com.company.huisuo.base.BaseCenterPopupView
import com.company.huisuo.biz.adapter.ArtistClothesAdapter
import com.company.huisuo.databinding.DialogArtistClothesBinding
import com.company.huisuo.widget.GridSpaceDecoration

/**
 * 艺人着装
 */
class ArtistClothesDialog(activity: Activity) : BaseCenterPopupView<DialogArtistClothesBinding>(
    activity
) {
    private val clothesAdapter by lazy {
        ArtistClothesAdapter()
    }
    private val roleAdapter by lazy {
        ArtistClothesAdapter()
    }

    override val getLayoutId: Int
        get() = R.layout.dialog_artist_clothes
    override val getViewBinding: DialogArtistClothesBinding
        get() = DialogArtistClothesBinding.bind(contentView)

    override fun initData() {
        mBinding.apply {
            ivClose.setOnClickListener {
                dismiss()
            }
            tvOk.setOnClickListener {
                dismiss()
            }
            rcv1.apply {
                layoutManager = GridLayoutManager(activity, 3)
                adapter = clothesAdapter
            }
            rcv2.apply {
                layoutManager = GridLayoutManager(activity, 3)
                adapter = roleAdapter
            }
        }
        clothesAdapter.submitList(mockClothesData())
        roleAdapter.submitList(mockRoleData())
    }

    private fun mockClothesData(): ArrayList<Pair<String, String>> {
        val list = arrayListOf<Pair<String, String>>()
        list.add(Pair("JK学生", ""))
        list.add(Pair("深V女仆", ""))
        list.add(Pair("花边护士", ""))
        list.add(Pair("旗袍", ""))
        list.add(Pair("御姐包臀", ""))
        list.add(Pair("圣诞兔子", ""))
        return list
    }

    private fun mockRoleData(): ArrayList<Pair<String, String>> {
        val list = arrayListOf<Pair<String, String>>()
        list.add(Pair("英语老师", "少年时代严厉性感的英语老师今晚为你私下补课..."))
        list.add(Pair("女同桌", "青涩腼腆的女同桌请你下课后去学校操场的小树林..."))
        list.add(Pair("女校长", "离异单身的女校长叫你晚自习去她办公室为她按摩..."))
        list.add(Pair("同学妈妈", "温柔的同学妈妈独自在家邀请你放学去家里挑选衣服..."))
        list.add(Pair("暗恋女神", "暗恋女神带你去到楼道死角请你帮她整理吊带..."))
        list.add(Pair("校花", "和校花约好今晚穿校服到私密KTV一起喝酒..."))
        return list
    }
}